package com.kgc.ssm.service.impl;

import com.kgc.ssm.beans.EdocCategory;
import com.kgc.ssm.beans.EdocEntry;
import com.kgc.ssm.mapper.EdocEntryMapper;
import com.kgc.ssm.service.EdocEntryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created on 2021/6/30.
 * <p>
 * Author: 190120
 * <p>
 * Description:
 */
@Service
public class EdocEntryServiceImpl implements EdocEntryService {

    @Autowired(required = false)
    private EdocEntryMapper edocEntryMapper;

    @Override
    public List<EdocEntry> queryEdocEntryList() {

        return edocEntryMapper.selectEdocEntryList();
    }

    @Override
    public void deleteEntryById(Integer id) {

        edocEntryMapper.deleteEntryByid(id);
    }

    @Override
    public List<EdocCategory> selectAllCategory() {
        return edocEntryMapper.selectAllCategories();
    }



    @Override
    public void insOrUpdEdocEntry(EdocEntry edocEntry) {
        edocEntryMapper.insOrUpdEdocEntries(edocEntry);
    }

    @Override
    public EdocEntry selectEntryById(Integer id) {
        return  edocEntryMapper.selectEntryByid(id);
    }



    @Override
    public void UpdEdocEntry(EdocEntry edocEntry) {
        edocEntryMapper.UpdEdocEntries(edocEntry);
    }

    @Override
    public List<EdocEntry> selectEntryByCid(Integer cid) {
        System.out.println(edocEntryMapper.selectEntriesByCid(cid));
        return edocEntryMapper.selectEntriesByCid(cid);
    }


}
